#ifndef _MACROCOMMAND_H
#define _MACROCOMMAND_H

#include "Notifier.h"
#include "ICommand.h"

using namespace Interface;
using namespace Core;

namespace Patterns
{
class MacroCommand : public Notifier, public ICommand
{
public:
    MacroCommand()
    {
    }

    void Execute(INotification* notification)
    {
        while (m_subCommands.size() > 0)
        {
            fnCreateICommand pfnCreateICommand = (fnCreateICommand)m_subCommands.front();
            (pfnCreateICommand())->Execute(notification);

            m_subCommands.pop_front();
        }
    }


protected:
    void AddSubCommand(void* commandType)
    {
        m_subCommands.push_back(commandType);
    }


private:
    list<void*>        m_subCommands;
};
}
#endif
